package eu.catlab.bbgs;

import java.io.File;

import org.kolich.security.PKCS8RSASigner;

public class Signature 
{
	private File privatekey;
	
	public Signature (File privatekey)
	{
		this.privatekey = privatekey; 
	}
	
	public String getSignature (String content)
	{
		PKCS8RSASigner signer = new PKCS8RSASigner (privatekey);
		
		byte[] signature = null;
		
		try 
		{
			signature = signer.getSignature(content.getBytes());
			
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
		
		return Base64.encodeBytes (signature);
	}
}
